package com.luhuiguo.cms.shared.event;

import com.google.gwt.event.shared.GwtEvent;
import com.luhuiguo.cms.shared.model.UserModel;

public class LogoutEvent extends GwtEvent<LogoutEventHandler> {

    public static Type<LogoutEventHandler> TYPE = new Type<LogoutEventHandler>();

    private UserModel userModel;

    public LogoutEvent() {
        this(null);
    }

    public LogoutEvent(UserModel userModel) {
        this.userModel = userModel;
    }

    @Override
    protected void dispatch(LogoutEventHandler handler) {
        handler.onLogout(this);
    }

    @Override
    public GwtEvent.Type<LogoutEventHandler> getAssociatedType() {
        return TYPE;
    }

    public UserModel getUserModel() {
        return userModel;
    }

}
